package top.withu.gaof.freehope.service.impl;

import org.springframework.stereotype.Service;
import top.withu.gaof.freehope.res.CountArticle;
import top.withu.gaof.freehope.service.ArticleService;
import top.withu.gaof.freehope.service.CommentService;
import top.withu.gaof.freehope.service.CountService;

import javax.annotation.Resource;

/**
 * @Description: TODO
 * @Author: gaofan
 * @Date: 2019/10/9 15:47
 * @Copyright: 2019 www.freehope.top Inc. All rights reserved.
 **/
@Service
public class CountServiceImpl implements CountService {

    @Resource
    private ArticleService articleService;

    @Resource
    private CommentService commentService;

    @Override
    public CountArticle count() {
        CountArticle countArticle = new CountArticle();
        countArticle.setArticleNum(articleService.countAll());
        countArticle.setCommentNum(commentService.countAll());
        return null;
    }
}
